package com.hertz.appr.service.timer;

import org.apache.log4j.Logger;

public class TestTimer {

	private boolean running = false;
	Logger log = Logger.getLogger(TestTimer.class);
	public void test()throws Exception{
		running = true;
		for(int i = 0; i < 10; i++){
			Thread.sleep(1000);
			log.info("===================test timer " + i + "=====================");
		}
		running = false;
	}
	
	public void destroy(){
		log.info("~~~~~~~destroy timer");
		while(running){
			log.info("timer is running");
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
